#include "childdialog.h"
#include "ui_childdialog.h"

childDialog::childDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::childDialog),
    parent_(parent)
{
    ui->setupUi(this);

    // 自己的信号 连接 自己的槽函数
    connect(ui->pushButton, &QPushButton::clicked, this, &childDialog::showMainWindowSlot);
}

childDialog::~childDialog()
{
    delete ui;
}

void childDialog::showMainWindowSlot(){
    this->hide();
    emit showMainWindowSignal();
}

void childDialog::showChildDialogSlot(int value){
    this->show();
    parent_->hide();
    qDebug() << value;
}
